]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: Avoid JS error when activating VPN connection
authorMichael Catanzaro <mcatanzaro@gnome.org>
Tue, 20 Dec 2016 20:00:42 +0000 (14:00 -0600)
committerMichael Catanzaro <mcatanzaro@gnome.org>
Tue, 27 Dec 2016 18:14:19 +0000 (12:14 -0600)
If the call to settings.get_connection_by_path in
ensureActiveConnectionProps returns null, we'll hit a JS error here.
Seems to happen always when activating a VPN connection. Avoid that.

Giovanni says:

"I believe this is papering over an existing bug, but it's possible for
settings.get_connection_by_path() to legitimately return null (if the
connection is owned by a different user and invisible to the current
one), so the fix is correct anyway."

https://bugzilla.gnome.org/show_bug.cgi?id=759793

js/ui/status/network.js

index 2c6d9d899eb99bb156fde1d9f82c8891a721eddc..835c315f65ecbfed85ffc7a68ffefae51ba7f45e 100644 (file)
@@ -1543,8 +1543,10 @@ const NMVPNSection = new Lang.Class({
             item.setActiveConnection(null);
         }
         vpnConnections.forEach(Lang.bind(this, function(a) {
-            let item = this._connectionItems.get(a._connection.get_uuid());
-            item.setActiveConnection(a);
+            if (a._connection) {
+                let item = this._connectionItems.get(a._connection.get_uuid());
+                item.setActiveConnection(a);
+            }
         }));
     },